package com.effect.exception;

import lombok.Getter;

/**
 * 返回值枚举
 */
@Getter
public enum ResultCode {


    SUCCESS(200, "请求成功"),
	FAILED(-100, "请求失败"),
    ENABLE_SUCCESS(200, "启用成功"),
    DISABLED_SUCCESS(200, "禁用成功"),
    DELETE_SUCCESS(200, "删除成功"),

    RSA_SUCCESS(200, "获取公钥成功"),
    RSA_FAIL(-101, "获取公钥失败"),
    SQL_ERROR(-103, "SQLError"),
    USER_NOT_EXIST(-105, "用户不存在"),
    NULL_Pointer_ERROR(-106, "空指针异常"),
    PWD_ERROR(-200, "密码错误，请检查"),
    LOGIN_FAILED(-201, "登录失败"),
    GRID_SWITCHING(208, "栅格图定位使用编码,误删,前端用208去处理逻辑了"),
    AUTHENTICATION_TOKEN_ERROR(401, "token已过期，请重新登录"),
    UNAUTHORIZED_ERROR(401, "未认证，请先登录"),
    ACCESS_DENIED_ERROR(-402, "暂无访问权限"),
    REQUEST_METHOD_ERROR(-405, "请求方式错误"),

    MISSING_PARAMETER(412,"必要参数缺失"),

    UNKNOWN_ERROR(500, "未知错误"),
    PARAM_ERROR(-106, "参数校验不通过"),
    DATA_ACCESS_ERROR(500, "数据库操作异常"),
    SYSTEM_ERROR(500, "服务异常"),
    THREAD_INTERRUPTED_ERROR(500, "线程意外中断"),
    HTTP_REQUEST_METHOD_NOT_SUPPORTED_ERROR(500, "请求方法不支持"),

    UPLOAD_FILE_CAN_NOT_EMPTY(10109, "上传文件内容不能为空"),
    USER_ID_CAN_NOT_EMPTY(10110, "添加人不能为空"),
    IMG_NOT_EXISTS(10108, "图片不存在"),

    MODEL_UPLOAD_ERROR(13001,"请检查压缩包"),
    MODEL_DEFECT_ERROR(13002,"模型缺陷为空"),

    MODEl_VERSION_NAME_ERROR(13003,"模型版本已存在"),
    FILE_TYPE_ERROR(13004,"模式错误" ),
    PRODUT_ERROR(13005,"料号不存在" ),



    /**PMi要求段号是 5000~5999*/
    SCOPE_REPEATNAME(5001,"区域名称重复" ),
    ID_IS_NOT_NULL(5002,"id缺失" ),
    NAME_IS_NOT_NULL(5003,"名称缺失" ),
    MODEl_NAME_ERROR(5004,"名称已存在"),
    SCOPE_IS_NULL(5005,"获取区域信息失败"),
    PARAM_MISSING(5006, "参数缺失:%s"),
    OUTLINE_ANALYZE_ERROR(5007, "轮廓数据解析异常"),
    POSITION_IS_NULL(5008,"获取面次信息失败"),
    POSITION_SCOPE__IS_NULL(5009,"获取面次区域信息失败"),
    RULE_IS_NULL(5010,"获取规则信息失败"),
    SCOPE_ALREADY_BINDING_RULE(5011,"面次区域已经绑定过该规则"),
    SPOT_LINGHT(5012,"点光光源亮度不能为空"),
    DAEK_LINGHT(5013,"暗场光源亮度不能为空"),
    CAMREA_IS_NULL(5014,"新建料号前请先设置面整相机"),
    DIE_LIST_IS_NULL(5015,"有效die数据缺失"),
    OUTLINE_DRAW_ERROR(5016,"未识别出轮廓绘制的有效die,请确认轮廓坐标"),
    CORRECT_MISSING_POINT(5017,"矫正点位信息缺失"),
    STEP_NUM_ERROR(5018,"视野和重合区相减不能小于0"),
    DEFECT_EMPTY_ERROR(5019, "产品缺陷数据为空"),
    FOCUS_ERROR(5020, "焦距设置失败"),
    FOCUS_CONNECT_ERROR(5021,"对焦服务连接失败，请开启对焦服务");




    private final int code;

    private final String value;

    ResultCode(int code, String value) {
        this.code = code;
        this.value = value;
    }

//    @Override
//    public int code() {
//        return code;
//    }
//
//    @Override
//    public String value() {
//        return value;
//    }
//
//    @Override
//    public String msg() {
//        // 这块后期可以做成从国际化中取值
//        return this.value();
//    }
}
